package com.qhs.framework.config;

import com.alibaba.druid.support.http.StatViewServlet;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by xinchao on 2016/12/13 0013.
 */
@Configuration
public class ServletConfig {

    @Bean
    public StatViewServlet statViewServlet(){
        return new StatViewServlet();
    }

    @Bean
    public ServletRegistrationBean test2ServletRegistrationBean(StatViewServlet statViewServlet){
        ServletRegistrationBean registration = new ServletRegistrationBean(statViewServlet);
        registration.setEnabled(true);
        registration.addUrlMappings("/servlet/test2");
        return registration;
    }
}
